package ${packageName};
<#if importClassName??>
    <#list importClassName as item>
import ${item};
    </#list>
</#if>
import org.springframework.web.multipart.MultipartFile;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.time.LocalDateTime;
import java.math.BigDecimal;

/**
 * @author xiaoyun461
 * ${.now?string('yyyy-MM-dd')}
 */
@RestController
<#if  desc??>
@Api(tags = "${className}", description = "${desc}")
</#if>
public class ${className} {

<#list methodsList as item>
    <#if item.tag??>
    /**
     * ${item.tag}
     */
    </#if>
    @${item.reqMethod}Mapping(value = "${item.methodUrl}")
    @ApiOperation("${item.methodDesc}")<#if item.reqBody?? && (item.reqBody?size > 0)>
    @ApiImplicitParams({<#list item.reqBody as req><#if req.fieldName??>
            @ApiImplicitParam(name = "${req.fieldName}"<#if req.fieldDesc??>, value = "${req.fieldDesc}"</#if><#if req.defaultValue??>, defaultValue = "${req.defaultValue}"</#if><#if req.required??>, required = true</#if>)<#if req_has_next>,</#if></#if></#list>})</#if>
    public <#if item.resBody??>${item.resBody}<#else>String</#if> ${item.methodName}(<#if item.reqBody??><#list item.reqBody as req><#if req.fieldAttr??>${req.fieldAttr} ${req.fieldName} <#if req_has_next>,</#if></#if></#list></#if>) {
        //TODO <#if  item.resBodyDesc??> ${item.resBodyDesc} </#if>
    <#if item.resBody??>    return new ${item.resBody}();<#else>return "OK";</#if>
    }

</#list>

}
